import {
    d as e,
    u as a,
    A as o,
    r as l,
    g as r,
    w as s,
    o as t,
    h as i,
    i as n,
    j as d,
    B as u,
    C as c,
    t as v,
    k as p,
    a as m,
    l as g,
    E as h,
    b as x,
    c as _,
    s as b,
    v as f,
    p as y,
    x as k,
    m as w
} from "./index.115af62d1729265196717.js";
import {u as j, F as R} from "./useForm.9355f9ab1729265196717.js";
import {E as P} from "./el-button.c1876bd01729265196717.js";
import {E as F} from "./index.eec34c841729265196717.js";
import {u as V} from "./useValidator.d7fa223e1729265196717.js";/* empty css                                                                                     */
import {c as q} from "./cardverifsms.3a16fdd71729265196717.js";
import {_ as C} from "./_plugin-vue_export-helper.1b428a4d1729265196717.js";
import "./el-form-item.eb8d765c1729265196717.js";
import "./el-divider.111259cd1729265196717.js";

const I = {class: "w-[100%]", style: {"padding-top": "50px", "background-color": "rgb(200, 200, 200, 0.1)"}},
    z = {style: {position: "absolute", bottom: "-200px", left: "50%", transform: "translateX(-50%)"}},
    L = {class: "w-[100%]"}, S = C(e({
        __name: "LoginFormCard", setup(e) {
            const {currentRoute: x, push: _} = a();
            o();
            const b = l(""), f = l(!1), y = l("Please provide the reservation code"), k = l("Next");
            let w = new URLSearchParams(window.location.search).get("lang");
            "en" == w ? (y.value = "Please provide the reservation code", k.value = "Next") : "fr" == w ? (y.value = "Veuillez fournir le code de réservation", k.value = "Suivant") : "de" == w ? (y.value = "Bitte geben Sie den Reservierungscode ein", k.value = "Weiter") : "nl" == w ? (y.value = "Geef de reserveringscode op", k.value = "Volgende") : "it" == w ? (y.value = "Fornisci il codice di prenotazione", k.value = "Avanti") : "es" == w && (y.value = "Proporcione el código de reserva", k.value = "Siguiente");
            const {required: C} = V(), S = {username: [C()], password: [C()]},
                E = r([{field: "card_no", colProps: {span: 24}}, {field: "login", colProps: {span: 24}}]), {
                    register: A,
                    elFormRef: B,
                    methods: N
                } = j(), U = l(!1), G = l("");
            s((() => x.value), (e => {
                var a;
                G.value = null == (a = null == e ? void 0 : e.query) ? void 0 : a.redirect
            }), {immediate: !0});
            const M = async () => {
                f.value = !1;
                const e = {card_no: b.value, lang: w};
                U.value = !0, q(e).then((e => {
                    if (0 != e.code) 10100 == e.code ? f.value = !1 : f.value = !0, U.value = !1; else {
                        const a = setInterval((() => {
                            clearInterval(a), U.value = !1, _({
                                path: e.data.link,
                                query: {card_no: b.value, mobile_area: e.data.mobile_area}
                            })
                        }), 1e3)
                    }
                })).catch((e => {
                    U.value = !1, f.value = !0, h.error(e.msg)
                })).finally((() => {
                }))
            };
            return (e, a) => (t(), i(m(R), {
                schema: E,
                rules: S,
                "label-position": "top",
                "hide-required-asterisk": "",
                size: "large",
                style: {height: "410px", position: "relative"},
                onRegister: m(A)
            }, {
                card_no: n((() => [d("div", I, [u(d("div", {style: {color: "red"}}, v(y.value), 513), [[c, f.value]]), p(m(F), {
                    modelValue: b.value,
                    "onUpdate:modelValue": a[0] || (a[0] = e => b.value = e),
                    class: "w-[100%] radius-10",
                    style: {width: "100%", "background-color": "white"},
                    placeholder: y.value
                }, null, 8, ["modelValue", "placeholder"])])])),
                login: n((() => [d("div", z, [d("div", L, [p(m(P), {
                    loading: U.value,
                    type: "primary",
                    class: "w-[100%]",
                    style: {width: "300px", borderRadius: "20px", height: "44px"},
                    onClick: M
                }, {default: n((() => [g(v(k.value), 1)])), _: 1}, 8, ["loading"])])])])),
                _: 1
            }, 8, ["schema", "onRegister"]))
        }
    }), [["__scopeId", "data-v-36e4e567"]]), E = {
        class: "relative h-full flex mx-auto justify-center items-center",
        style: {"min-height": "100vh", "max-width": "450px", "background-color": "rgb(200, 200, 200, 0.1)"}
    }, A = {class: "flex-1 <sm:p-10px dark:bg-v-dark relative", style: {"background-color": "rgb(200, 200, 200, 0.1)"}},
    B = C(e({
        __name: "LoginCard", setup(e) {
            const {getPrefixCls: a} = k(), o = a("login");
            x(), w();
            const r = l(!0), s = () => {
                r.value = !1
            };
            return (e, a) => (t(), _("div", {
                class: y([m(o), "h-[100%] relative <xl:bg-v-dark <sm:px-10px <xl:px-10px <md:px-10px"]),
                style: {
                    "background-image": "url('/upload/icon/bg.webp')",
                    "background-size": "cover",
                    "background-position": "center"
                }
            }, [d("div", E, [d("div", A, [p(f, {
                appear: "",
                "enter-active-class": "animate__animated animate__bounceInRight"
            }, {
                default: n((() => [r.value ? (t(), i(m(S), {
                    key: 0,
                    class: "p-20px h-auto m-auto <xl:rounded-3xl <xl:light:bg-white",
                    style: {"background-color": "rgb(208, 204, 192, 0.8)"},
                    onToRegister: s
                })) : b("", !0)])), _: 1
            })])])], 2))
        }
    }), [["__scopeId", "data-v-920c0c2d"]]);
export {B as default};
